// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using System;
using System.Threading;
using System.Threading.Tasks;

#nullable restore
namespace Elastic.Clients.Elasticsearch.Logstash
{
	public class LogstashNamespace : NamespacedClientProxy
	{
		internal LogstashNamespace(ElasticsearchClient client) : base(client)
		{
		}

		public LogstashDeletePipelineResponse DeletePipeline(LogstashDeletePipelineRequest request)
		{
			request.BeforeRequest();
			return DoRequest<LogstashDeletePipelineRequest, LogstashDeletePipelineResponse>(request);
		}

		public Task<LogstashDeletePipelineResponse> DeletePipelineAsync(LogstashDeletePipelineRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<LogstashDeletePipelineRequest, LogstashDeletePipelineResponse>(request, cancellationToken);
		}

		public LogstashDeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsearch.Id id)
		{
			var descriptor = new LogstashDeletePipelineRequestDescriptor(id);
			descriptor.BeforeRequest();
			return DoRequest<LogstashDeletePipelineRequestDescriptor, LogstashDeletePipelineResponse>(descriptor);
		}

		public LogstashDeletePipelineResponse DeletePipeline(Elastic.Clients.Elasticsearch.Id id, Action<LogstashDeletePipelineRequestDescriptor> configureRequest)
		{
			var descriptor = new LogstashDeletePipelineRequestDescriptor(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<LogstashDeletePipelineRequestDescriptor, LogstashDeletePipelineResponse>(descriptor);
		}

		public LogstashDeletePipelineResponse DeletePipeline<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<LogstashDeletePipelineRequestDescriptor<TDocument>> configureRequest)
		{
			var descriptor = new LogstashDeletePipelineRequestDescriptor<TDocument>(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<LogstashDeletePipelineRequestDescriptor<TDocument>, LogstashDeletePipelineResponse>(descriptor);
		}

		public Task<LogstashDeletePipelineResponse> DeletePipelineAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default)
		{
			var descriptor = new LogstashDeletePipelineRequestDescriptor(id);
			descriptor.BeforeRequest();
			return DoRequestAsync<LogstashDeletePipelineRequestDescriptor, LogstashDeletePipelineResponse>(descriptor);
		}

		public Task<LogstashDeletePipelineResponse> DeletePipelineAsync(Elastic.Clients.Elasticsearch.Id id, Action<LogstashDeletePipelineRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new LogstashDeletePipelineRequestDescriptor(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<LogstashDeletePipelineRequestDescriptor, LogstashDeletePipelineResponse>(descriptor);
		}

		public Task<LogstashDeletePipelineResponse> DeletePipelineAsync<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<LogstashDeletePipelineRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new LogstashDeletePipelineRequestDescriptor<TDocument>(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<LogstashDeletePipelineRequestDescriptor<TDocument>, LogstashDeletePipelineResponse>(descriptor);
		}

		public LogstashPutPipelineResponse PutPipeline(LogstashPutPipelineRequest request)
		{
			request.BeforeRequest();
			return DoRequest<LogstashPutPipelineRequest, LogstashPutPipelineResponse>(request);
		}

		public Task<LogstashPutPipelineResponse> PutPipelineAsync(LogstashPutPipelineRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<LogstashPutPipelineRequest, LogstashPutPipelineResponse>(request, cancellationToken);
		}

		public LogstashPutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Id id)
		{
			var descriptor = new LogstashPutPipelineRequestDescriptor(id);
			descriptor.BeforeRequest();
			return DoRequest<LogstashPutPipelineRequestDescriptor, LogstashPutPipelineResponse>(descriptor);
		}

		public LogstashPutPipelineResponse PutPipeline(Elastic.Clients.Elasticsearch.Id id, Action<LogstashPutPipelineRequestDescriptor> configureRequest)
		{
			var descriptor = new LogstashPutPipelineRequestDescriptor(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<LogstashPutPipelineRequestDescriptor, LogstashPutPipelineResponse>(descriptor);
		}

		public LogstashPutPipelineResponse PutPipeline<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<LogstashPutPipelineRequestDescriptor<TDocument>> configureRequest)
		{
			var descriptor = new LogstashPutPipelineRequestDescriptor<TDocument>(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<LogstashPutPipelineRequestDescriptor<TDocument>, LogstashPutPipelineResponse>(descriptor);
		}

		public Task<LogstashPutPipelineResponse> PutPipelineAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default)
		{
			var descriptor = new LogstashPutPipelineRequestDescriptor(id);
			descriptor.BeforeRequest();
			return DoRequestAsync<LogstashPutPipelineRequestDescriptor, LogstashPutPipelineResponse>(descriptor);
		}

		public Task<LogstashPutPipelineResponse> PutPipelineAsync(Elastic.Clients.Elasticsearch.Id id, Action<LogstashPutPipelineRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new LogstashPutPipelineRequestDescriptor(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<LogstashPutPipelineRequestDescriptor, LogstashPutPipelineResponse>(descriptor);
		}

		public Task<LogstashPutPipelineResponse> PutPipelineAsync<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<LogstashPutPipelineRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new LogstashPutPipelineRequestDescriptor<TDocument>(id);
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<LogstashPutPipelineRequestDescriptor<TDocument>, LogstashPutPipelineResponse>(descriptor);
		}
	}
}